1. Field of the Invention
The present invention relates to a method and an apparatus for converting a program for a computer of a first architecture to a machine program adapted for a computer of a second architecture, and to a method and an apparatus for debugging a machine program produced by the above method and apparatus.
2. Description of the Related Art
When a computer of a new architecture which is different from a present architecture is developed, it is necessary to debug a machine program for the computer. However, in general, when the machine program for the new computer is to be debugged, a new computer (hardware) is not completely produced, i.e., does not actually exist. Therefore, it is impossible to actually debug the machine program on the new computer.
Conventionally, to debug a machine program adapted for a computer of a new architecture, a simulator for simulating a hardware function of the new computer in a software process is used. However, since a simulator for simulating a conventional architecture cannot be used for this purpose, the conventional simulator must be reformed or a new simulator suitable for the new architecture must be developed.
In general, debugging of a machine program by using a simulator is achieved as follows: instruction codes of the machine program are serially fetched and decoded by software processes, and the machine program is debugged by simulating operations in accordance with the instruction codes.
As described above, according to conventional art, when a machine program for a computer of a new architecture is debugged by a simulator, the simulator must be modified for the purpose of the debugging. Reform of a simulator or development of a new simulator requires a considerable period of time. Particularly when a plurality of new architectures are developed and it is necessary to select one architecture to be actually used, simulators corresponding to the respective architectures must be prepared.
In debugging of a machine program using a simulator, since instruction codes are serially fetch and decoded by software processes, execution of simulation is very time-consuming.